<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/co/4.1.0/index.js"></script>
</head>
<body>
    <script>
        function http(url){
            return $.ajax({
                url,
                dataType:"jsonp"
            })
        }
        co(function *(){
            var data = yield http("https://api.douban.com/v2/movie/search?q=你的名字&count=1");
            var id = data.subjects[0].id;
            console.log(id);
            var detail  = yield http('https://api.douban.com/v2/movie/'+id);
            console.log(detail)
        })
    </script>
</body>
</html>